package com.kuangstudy.io.serialization;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * ClassName: UnsafeBuyTicket
 * date: 2021/07/16 22:26:47
 *对象序列化 ObjectOutputStream 把指定对象写入到ObjectOutputStream
 * 特定成员方法 void writeObject(Obj obj)
 * @author zlk
 */
public class Demo1 {
    public static void main(String[] args) throws IOException {
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("e:\\person.txt"));
        oos.writeObject(new Person("kk",18));
        oos.close();
    }
}
